/**
 * API 接口统一管理
 * 使用统一的 request 工具类
 */
import request from '@/utils/request'
import type { ApiResponse } from './types/common'

// 导出请求实例
export const apiClient = request

// 导出类型
export type { ApiResponse }

// API 端点常量
export const API_ENDPOINTS = {
  // 公告相关
  ANNOUNCEMENTS: '/index/getAnnouncements',
  ANNOUNCEMENT_DETAIL: '/index/getAnnouncementDetail',

  // 统计数据相关
  DASHBOARD_STATS: '/index/getDashboardStats',
  MAP_PASSWORDS: '/index/getMapPasswords',
  MOST_FAVORITE_ITEMS: '/index/getMostFavoriteItems',

  // 排行榜相关
  RANKING_LIST: '/ranking/getRankingList',

  // 用户认证相关
  USER_CHECK_IN: '/user/checkIn',
  USER_LOGOUT: '/user/logout',
  USER_INFO: '/user/info',
  USER_REFRESH_TOKEN: '/user/refreshToken',

  // 验证码相关
  GET_CAPTCHA: '/common/captcha',
  GET_CLICK_CAPTCHA: '/common/clickCaptcha',
  CHECK_CLICK_CAPTCHA: '/common/checkClickCaptcha',
  SEND_EMAIL_CODE: '/ems/send',

  // 账户管理相关
  ACCOUNT_OVERVIEW: '/account/overview',
  ACCOUNT_PROFILE: '/account/profile',
  ACCOUNT_CHANGE_PASSWORD: '/account/changePassword',
  ACCOUNT_RETRIEVE_PASSWORD: '/account/retrievePassword',
  ACCOUNT_VERIFICATION: '/account/verification',
  ACCOUNT_CHANGE_BIND: '/account/changeBind',
  ACCOUNT_INTEGRAL: '/account/integral',
  ACCOUNT_BALANCE: '/account/balance',

  // 收藏相关
  ACCOUNT_ADD_FAVORITE: '/account/addFavorite',
  ACCOUNT_REMOVE_FAVORITE: '/account/removeFavorite',
  ACCOUNT_CHECK_FAVORITE: '/account/checkFavorite',
  ACCOUNT_BATCH_CHECK_FAVORITES: '/account/batchCheckFavorites',
  ACCOUNT_GET_FAVORITES: '/account/getFavorites',

  // 功能请求相关
  FEATURE_LIST: '/feature/index',
  FEATURE_DETAIL: '/feature/detail',
  FEATURE_SUBMIT: '/feature/submit',
  FEATURE_VOTE: '/feature/vote',
  FEATURE_STATUS: '/feature/getStatus',

  // 装备推荐相关
  LOADOUT_GET_RECOMMENDATION: '/api/LoadoutRecommendation/getRecommendation',
  LOADOUT_GET_CATEGORIES: '/api/LoadoutRecommendation/getCategories',
  LOADOUT_GET_SLOT_MAPPING: '/api/LoadoutRecommendation/getSlotMapping',
  LOADOUT_GET_COMPATIBLE_ACCESSORIES: '/api/LoadoutRecommendation/getCompatibleAccessories',
  LOADOUT_SAVE_RECOMMENDATION: '/api/LoadoutRecommendation/saveRecommendation',
  LOADOUT_GET_RECOMMENDATION_HISTORY: '/api/LoadoutRecommendation/getRecommendationHistory'
} as const

// 导出默认实例（向后兼容）
export default apiClient